﻿Public Class Form6
    Dim OpacityDirection As String = "UP"
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

        If OpacityDirection = "UP" Then
            Me.Opacity = Me.Opacity + 0.01
        Else
            Me.Opacity = Me.Opacity - 0.01
        End If

        If Opacity = 1 Then
            OpacityDirection = "DOWN"
        ElseIf Opacity < 0.05 Then
            Me.Close()
        End If

        If Opacity > 0.8 Then
            Timer1.Interval = 50
        ElseIf Opacity = Opacity < 0.7 Then
            Timer1.Interval = 5
        End If



        'If Label1.Text.Length < 40 Then
        '    Me.Width = 300
        'ElseIf Label1.Text.Length > 40 And Label1.Text.Length < 50 Then
        '    Me.Width = 300
        'ElseIf Label1.Text.Length >= 50 And Label1.Text.Length < 60 Then
        '    Me.Width = 400
        'ElseIf Label1.Text.Length >= 60 And Label1.Text.Length < 70 Then
        '    Me.Width = 500
        'ElseIf Label1.Text.Length >= 70 And Label1.Text.Length < 80 Then
        '    Me.Width = 600
        'Else
        'End If
        ' '' '' ''If Label1.Width > 110 Then
        ' '' '' ''    Me.Width = Label1.Width + 10
        ' '' '' ''    '    GroupBox1.Width = Me.Width - 7
        ' '' '' ''Else
        ' '' '' ''    Me.Width = 120
        ' '' '' ''    '    GroupBox1.Width = Me.Width - 7
        ' '' '' ''End If


        '  Label1.Text = Me.Opacity
    End Sub

    Private Sub Form6_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If Trim(Label1.Text) = "" Then
            Timer1.Enabled = False
            Me.Close()
        Else
            Timer1.Enabled = True
        End If

        ''    Me.Left = Control.MousePosition.X
        ' Me.Left = Screen.PrimaryScreen.WorkingArea.Width - Me.Width - 50


        Me.Top = Screen.PrimaryScreen.WorkingArea.Height - Me.Height - 10
        Me.Left = Screen.PrimaryScreen.WorkingArea.Width - Me.Width - 50
    
        '   GroupBox1.Width = Me.Width - 4

    End Sub

 
    Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click

    End Sub
End Class